<!DOCTYPE html>
<html lang="cg">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
   var num = prompt("请输入三位数");
   if(num>=100&&num<1000){
   var bai = parseInt(num/100);
   var shi = parseInt(num/10%10);
   var ge = parseInt(num%10);
   if(bai<shi){
    temp = bai;
    bai = shi;
    shi = temp;
   }
   if(bai<ge){
    temp = bai;
    bai = ge;
    ge = temp;
   }
   if(shi<ge){
    temp = shi;
    shi = ge;
    ge = temp;
   }
   var num =""+bai+shi+ge;
   console.log(num);
   }else{
    alert("输入错误")
   }
</script>